package textdiff {
	
	import util.Map;

	/**
	 * Manages a set of Symbols. Current implementation is a HashMap.
	 */
	public class SymbolCollection {
	    var symbols:Map = new Map();
	
	    public function getSymbolFor(line:String): Symbol {
	        var symbol:Symbol = symbols.getItem( line ) as Symbol;
	        if (symbol == null) {
	            symbol = new Symbol();
	            symbols.putItem( line, symbol );
	        }
	        return symbol;
	    }
	
	    public function registerSymbol(fileIx:int, line:String, lineNum:int): int {
	        return getSymbolFor( line ).countLine( fileIx, lineNum );
	    }
	
	    public function getStateOf(line:String): int {
	        return getSymbolFor( line ).state;
	    }
	}
}